<?php

namespace app\controller\admin;

use app\bll\Site as BllSite;
use core\controller\AdminBase;
use Exception;
use support\View;

class Site extends AdminBase
{
    public function basicinfo()
    {
        $bllSite = new BllSite();
        if (is_post()) {
            try {
                $bllSite->edit(request()->nowsiteid, request()->post());
            } catch (Exception $ex) {
                return $this->error($ex->getMessage());
            }
            return $this->success();
        } else {


            $siteinfo = $bllSite->find(request()->nowsiteid);
            View::assign('siteinfo', $siteinfo);
            return $this->view();
        }
    }
}
